<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/WEB-INF/view/common/talent-header.jspf" %>
		<h1>职位详细信息</h1>
		<hr>
		<div style="width:600px;margin:0 auto">
			<h2>职位相关信息：</h2>
			职位名称：${position.name }<br>
			职责说明：${position.duty }<br>
			能力要求：${position.ability }<br>
			薪　　资：${position.salary1 }-${position.salary2 }<br>
			发布时间：<fmt:formatDate value="${position.releaseTime }" pattern="yyyy-MM-dd"/><br>
			<h2>公司相关信息：</h2>
			企业名称：${position.company$name }<br>
			企业邮箱：${position.company$email }<br>
			联系电话：${position.company$phone }<br>
			联 系 人 ：${position.company$linkman }<br>
			联系地址：${position.company$address }<br>
			人　　数：${position.company$numbers }<br>
			服务宗旨："${position.company$slogan }"<br><br>
	
			<c:if test="${empty application }">
				<select id="resume">
					<option value="">-请选择简历-</option>
					<c:forEach items="${resumeList }" var="resume">
						<option value="${resume.id }">${resume.intention }</option>
					</c:forEach>
				</select>
				<button class="btn btn-primary" onclick="apply();">投个简历</button>
			</c:if>
			<c:if test="${!empty application }">
				<span class="label label-success">已投递，${application.statusStr }</span>
			</c:if>
			<button class="btn btn-default" onclick="location='<%=request.getContextPath() %>/PositionServlet?command=queryAll'">返回招聘首页</button>
		</div>
<%@ include file="/WEB-INF/view/common/footer.jspf" %>
		<script>
			
			function apply() {
				 var resumeId = document.getElementById('resume').value;
				 if (resumeId == '') {
					 alert('请先选择简历，再执行职位投递!');
				 } else {
					 location='<%=request.getContextPath() %>/ApplicationServlet?command=apply&resumeId=' + resumeId + '&positionId=${position.id}'
				 }
			}		 
		</script>
	</body>
</html>